package com.snake.mylibrary.db_provider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.snake.mylibrary.utils.LogUtil;

public class DBOpenHelper extends SQLiteOpenHelper {

    public DBOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    /**当数据库首次运行的时候调用这个方法*/
    @Override
    public void onCreate(SQLiteDatabase db) {
        //创建表
        LogUtil.e("创建表");
        db.execSQL(DBConfig.CREATE_TABLE_NAME1);
        db.execSQL(DBConfig.CREATE_TABLE_NAME2);
        db.execSQL(DBConfig.CREATE_TABLE_NAME3);
    }
    /**当改变版本号的时候调用这个方法*/
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
